#include <stdio.h>
int count_spaces(const char *s)
{
    int count = 0;
    for (; *s != '\0'; s++)
        if (*s == ' ')
            count++;
    return count;
}
int count_spaces2(const char *s)
{
    int count = 0;
    do
    {
        if (*s == ' ')
            count++;
    } while (*s++);
    return count;
}
int main(void)
{
    printf("%d\n", count_spaces(" 1 2 3 4 5   89 "));
    printf("%d\n", count_spaces2(" 1 2 3 4 5   89 "));
    return 0;
}